const mongoose = require('mongoose');
const dbURL = 'mongodb://localhost:27017/insurance_system'; // 连接数据库
mongoose.connect(dbURL, {
  useNewUrlParser: true,
  useUnifiedTopology: true,
});
// 当数据库连接成功后触发该事件
mongoose.connection.once('open', () => {
  console.log(dbURL + ' 数据库连接成功');
});
